﻿using Emgu.CV;
using Emgu.CV.Structure;
using FirstFloor.ModernUI.Windows.Controls;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Media;
using Vtron.LEDCorrective.Core;
using Vtron.LEDCorrective.Domain.LEDSender;
using Vtron.LEDCorrective.EDSDKWrapper;
using Vtron.LEDCorrective.Infrastructure;

namespace Vtron.LEDCorrective
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : ModernWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            Loaded += MainWindow_Loaded;
        }

        void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            CorrectiveEngine correctiveEngine = CorrectiveEngine.Instance;

            SCP_GET_COLORTEMP getColorTemp = new SCP_GET_COLORTEMP();
            getColorTemp.mode = 0;
            getColorTemp.senderId = correctiveEngine.GetWall().wall[0].modpg[0].senderId;
            var a = correctiveEngine.GetColorTemp(getColorTemp);
            SCP_COLORTEMP_T b = a;

            b.mode = 4;
            b.brightR = 1;
            b.brightG = 2;
            b.brightB = 3;

            SCP_SET_COLORTEMP SCP_SET_COLORTEMP1 = new SCP_SET_COLORTEMP();
            SCP_SET_COLORTEMP1.colorTemp = b;
            SCP_SET_COLORTEMP1.senderId = correctiveEngine.GetWall().wall[0].modpg[0].senderId;

            correctiveEngine.SetColorTemp(SCP_SET_COLORTEMP1);

            correctiveEngine.GetColorTemp(getColorTemp);
        }
    }
}
